package com.forekonow.view;

import com.forekonow.Service.impl.EmpServiceImpl;
import com.forekonow.dao.EmpDao;
import com.forekonow.dao.impl.EmpDaoImpl;
import com.forekonow.model.Emp;

public class MainWindow {

    public static void main(String[] args) {
        EmpServiceImpl service = new EmpServiceImpl();
        EmpDao dao = new EmpDaoImpl();
        service.setEmpDao(dao);//初始化接口,否则会出现NullPointerException空指针异常
        Emp emp = new Emp();
        emp.setEmpno(1000);
        emp.setEname("fender");
        emp.setJob("market");
        boolean isRight = service.add(emp);
        if(isRight) {
            System.out.println("insert success");
        }else {
            System.out.println("insert fail");
        }
    }
}
